package com.droowa.domain;

import java.io.Serializable;

public class MileageOption implements Serializable{

	private int truncationFee;
	private String truncationOption;
	private int ratio;
	private int joinMileageOption;
	private int availableMinPriceOption;
	private int availableMaxPriceOption;
	
	public MileageOption() {
		super();
	}
	public MileageOption(int truncationFee, String truncationOption, int ratio,
			int joinMileageOption, int availableMinPriceOption,
			int availableMaxPriceOption) {
		super();
		this.truncationFee = truncationFee;
		this.truncationOption = truncationOption;
		this.ratio = ratio;
		this.joinMileageOption = joinMileageOption;
		this.availableMinPriceOption = availableMinPriceOption;
		this.availableMaxPriceOption = availableMaxPriceOption;
	}
	
	public int getTruncationFee() {
		return truncationFee;
	}
	public void setTruncationFee(int truncationFee) {
		this.truncationFee = truncationFee;
	}
	public String getTruncationOption() {
		return truncationOption;
	}
	public void setTruncationOption(String truncationOption) {
		this.truncationOption = truncationOption;
	}
	public int getRatio() {
		return ratio;
	}
	public void setRatio(int ratio) {
		this.ratio = ratio;
	}
	public int getJoinMileageOption() {
		return joinMileageOption;
	}
	public void setJoinMileageOption(int joinMileageOption) {
		this.joinMileageOption = joinMileageOption;
	}
	public int getAvailableMinPriceOption() {
		return availableMinPriceOption;
	}
	public void setAvailableMinPriceOption(int availableMinPriceOption) {
		this.availableMinPriceOption = availableMinPriceOption;
	}
	public int getAvailableMaxPriceOption() {
		return availableMaxPriceOption;
	}
	public void setAvailableMaxPriceOption(int availableMaxPriceOption) {
		this.availableMaxPriceOption = availableMaxPriceOption;
	}
	@Override
	public String toString() {
		return "MileageOption [truncationFee=" + truncationFee
				+ ", truncationOption=" + truncationOption + ", ratio=" + ratio
				+ ", joinMileageOption=" + joinMileageOption
				+ ", availableMinPriceOption=" + availableMinPriceOption
				+ ", availableMaxPriceOption=" + availableMaxPriceOption + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + availableMaxPriceOption;
		result = prime * result + availableMinPriceOption;
		result = prime * result + joinMileageOption;
		result = prime * result + ratio;
		result = prime * result + truncationFee;
		result = prime
				* result
				+ ((truncationOption == null) ? 0 : truncationOption.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MileageOption other = (MileageOption) obj;
		if (availableMaxPriceOption != other.availableMaxPriceOption)
			return false;
		if (availableMinPriceOption != other.availableMinPriceOption)
			return false;
		if (joinMileageOption != other.joinMileageOption)
			return false;
		if (ratio != other.ratio)
			return false;
		if (truncationFee != other.truncationFee)
			return false;
		if (truncationOption == null) {
			if (other.truncationOption != null)
				return false;
		} else if (!truncationOption.equals(other.truncationOption))
			return false;
		return true;
	}
	
}
